home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Interactive 7
/
PC World Interactive 7.iso
/
program
/
qbprog.EXE
/
DENKLEM.BAS
< prev
next >
Wrap
BASIC Source File
|
1995-05-12
|
1KB
|
43 lines
10 ' 2. DERECE DENKLEMÿN KÖKLERÿNÿ BULAN PROGRAM. DENKLEM.BAS
20 CLS: PRINT "DENKLEMÿN KATSAYILARINI GÿRÿN":PRINT "AX²+BX+C"
30 INPUT "A=";A: INPUT "B=";B: INPUT "C=";C
40 'CIKIS
50 IF A=0 AND B=0 AND C=0 THEN 280
60 IF A=0 THEN PRINT:PRINT "A SIFIR OLAMAZ !":GOTO 260
70 ' DELTANIN HESAPLANMASI
80 D=B^2-4*A*C
90 '
100 'DENKLEM VE DELTANIN YAZILMASI
110 CLS:PRINT "DENKLEM: ";: GOSUB 300:'DENKLEM YAZILIMI'
120 LOCATE 3,1:PRINT "DELTA=";D:
130 IF D>0 THEN GOSUB 390:GOTO 160
140 IF D=O THEN GOSUB 390:GOTO 190
150 IF D<O THEN 230
160 ' D>0
170 LOCATE 5,1:PRINT "Ç={";K1;",";K2;"}"
180 GOTO 260:'CIKIS
190 ' D=0
200 LOCATE 5,1:COLOR 15: PRINT"DENKLEMÿN TEK KÖKÜ VAR !":COLOR 7
210 LOCATE 7,1:PRINT "Ç={";K1;"}"
220 GOTO 260 :'CIKIS
230 ' D<0
240 LOCATE 5,1:COLOR 31: PRINT "DENKLEMÿN GERÇEL KÖKLERI YOK!":SOUND 1000,2:COLOR 7
250 'CIKIS
260 PRINT:PRINT:PRINT:PRINT:PRINT "DEVAM ÿÇÿN <ENTER>":
270 Q$=INPUT$(1):IF ASC(Q$)=13 THEN 20
280 PRINT:PRINT:PRINT:PRINT:COLOR 19:PRINT"PROGRAM BÿTMÿ₧TIR !":COLOR 7
290 END
300 'DENKLEM YAZIMI
310 IF A=1 THEN PRINT "x²"; ELSE PRINT A;"x²";
320 IF B=0 THEN 350
330 IF B>0 THEN PRINT "+";
340 IF B=1 THEN PRINT "x"; ELSE PRINT B;"x";
350 IF C=0 THEN 380
360 IF C>0 THEN PRINT "+";
370 PRINT C
380 RETURN
390 'DENKLEM KÖKLERÿNÿN HESAPLANMASI
400 K1=(-B-(SQR(D)))/(2*A)
410 K2=(-B+(SQR(D)))/(2*A)
420 RETURN:' MURAT NECÿOªLU